\hypertarget{class_caziac_1_1_http_1_1_a_handle_response}{
\section{Caziac::Http::AHandleResponse Class Reference}
\label{class_caziac_1_1_http_1_1_a_handle_response}\index{Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}}
}


Handle for an HtttpResponse.  


{\ttfamily \#include $<$AHandleResponse.hh$>$}\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_caziac_1_1_http_1_1_a_handle_response_abb512fed3ee2a3f6e616d9560822444b}{AHandleResponse} (\hyperlink{class_caziac_1_1_tools_1_1_i_writer}{Tools::IWriter} $\ast$writer)
\begin{DoxyCompactList}\small\item\em constructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_response}{HandleResponse} \item\end{DoxyCompactList}\item 
\hypertarget{class_caziac_1_1_http_1_1_a_handle_response_aeb45bca84c6ee7b3778064c9a813df72}{
virtual \hyperlink{class_caziac_1_1_http_1_1_a_handle_response_aeb45bca84c6ee7b3778064c9a813df72}{$\sim$AHandleResponse} ()}
\label{class_caziac_1_1_http_1_1_a_handle_response_aeb45bca84c6ee7b3778064c9a813df72}

\begin{DoxyCompactList}\small\item\em destructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_response}{HandleResponse} \item\end{DoxyCompactList}\item 
std::multimap$<$ std::string, std::string $>$ const \& \hyperlink{class_caziac_1_1_http_1_1_a_handle_response_a825e837939fc7f2551fca7723d1e9ea3}{getHeader} () const 
\begin{DoxyCompactList}\small\item\em this function get the header of the Response \item\end{DoxyCompactList}\item 
\hyperlink{struct_caziac_1_1_http_1_1_line_response}{LineResponse} \& \hyperlink{class_caziac_1_1_http_1_1_a_handle_response_abec29b5fc318e4767cdf37676c070c43}{getLineResponse} ()
\begin{DoxyCompactList}\small\item\em this function get the \hyperlink{struct_caziac_1_1_http_1_1_line_response}{LineResponse} (method url version) \item\end{DoxyCompactList}\item 
void \hyperlink{class_caziac_1_1_http_1_1_a_handle_response_a285539dd02b020491752fa828148076c}{pack} ()
\begin{DoxyCompactList}\small\item\em write The \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest}, the Header content and an empty line \item\end{DoxyCompactList}\item 
bool \hyperlink{class_caziac_1_1_http_1_1_a_handle_response_aa418134fb4b7ba580e1b7f6d94342f80}{sendBody} (std::string const \&bodyline)
\begin{DoxyCompactList}\small\item\em send a body line or an entire body \item\end{DoxyCompactList}\item 
\hypertarget{class_caziac_1_1_http_1_1_a_handle_response_a699dbb075c8b7a31f0ce2a87c8d0686f}{
void \hyperlink{class_caziac_1_1_http_1_1_a_handle_response_a699dbb075c8b7a31f0ce2a87c8d0686f}{addDescription} (std::string const \&key, std::string const \&def)}
\label{class_caziac_1_1_http_1_1_a_handle_response_a699dbb075c8b7a31f0ce2a87c8d0686f}

\begin{DoxyCompactList}\small\item\em add a description to the Header \item\end{DoxyCompactList}\item 
virtual bool \hyperlink{class_caziac_1_1_http_1_1_a_handle_response_ad98942771b7d8ae11889857ab805d734}{operator==} (bool const)=0
\begin{DoxyCompactList}\small\item\em \mbox{[}User Implementation\mbox{]} \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Handle for an HtttpResponse. 

\subsection{Constructor \& Destructor Documentation}
\hypertarget{class_caziac_1_1_http_1_1_a_handle_response_abb512fed3ee2a3f6e616d9560822444b}{
\index{Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}!AHandleResponse@{AHandleResponse}}
\index{AHandleResponse@{AHandleResponse}!Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}}
\subsubsection[{AHandleResponse}]{\setlength{\rightskip}{0pt plus 5cm}Caziac::Http::AHandleResponse::AHandleResponse ({\bf Tools::IWriter} $\ast$ {\em writer})}}
\label{class_caziac_1_1_http_1_1_a_handle_response_abb512fed3ee2a3f6e616d9560822444b}


constructor of the \hyperlink{class_caziac_1_1_http_1_1_handle_response}{HandleResponse} 
\begin{DoxyParams}{Parameters}
\item[{\em writer}]the Socket writer This will set attribue \char`\"{}\_\-writer\char`\"{} for later using \end{DoxyParams}


\subsection{Member Function Documentation}
\hypertarget{class_caziac_1_1_http_1_1_a_handle_response_a825e837939fc7f2551fca7723d1e9ea3}{
\index{Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}!getHeader@{getHeader}}
\index{getHeader@{getHeader}!Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}}
\subsubsection[{getHeader}]{\setlength{\rightskip}{0pt plus 5cm}std::multimap$<$std::string, std::string$>$ const\& Caziac::Http::AHandleResponse::getHeader () const}}
\label{class_caziac_1_1_http_1_1_a_handle_response_a825e837939fc7f2551fca7723d1e9ea3}


this function get the header of the Response \begin{DoxyReturn}{Returns}
the header
\end{DoxyReturn}
This function return the header parsed by the user with the consumeHeaderLine method. This member function is for consulting. \hypertarget{class_caziac_1_1_http_1_1_a_handle_response_abec29b5fc318e4767cdf37676c070c43}{
\index{Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}!getLineResponse@{getLineResponse}}
\index{getLineResponse@{getLineResponse}!Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}}
\subsubsection[{getLineResponse}]{\setlength{\rightskip}{0pt plus 5cm}{\bf LineResponse}\& Caziac::Http::AHandleResponse::getLineResponse ()}}
\label{class_caziac_1_1_http_1_1_a_handle_response_abec29b5fc318e4767cdf37676c070c43}


this function get the \hyperlink{struct_caziac_1_1_http_1_1_line_response}{LineResponse} (method url version) \begin{DoxyReturn}{Returns}
the line response 
\end{DoxyReturn}
\begin{DoxyWarning}{Warning}
call readResponseHeader before to set the \hyperlink{struct_caziac_1_1_http_1_1_line_response}{LineResponse} attributes 
\end{DoxyWarning}
\hypertarget{class_caziac_1_1_http_1_1_a_handle_response_ad98942771b7d8ae11889857ab805d734}{
\index{Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}!operator==@{operator==}}
\index{operator==@{operator==}!Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}}
\subsubsection[{operator==}]{\setlength{\rightskip}{0pt plus 5cm}Caziac::Http::AHandleResponse::operator== (bool const)\hspace{0.3cm}{\ttfamily  \mbox{[}pure virtual\mbox{]}}}}
\label{class_caziac_1_1_http_1_1_a_handle_response_ad98942771b7d8ae11889857ab805d734}


\mbox{[}User Implementation\mbox{]} This function should return true if the \hyperlink{struct_caziac_1_1_http_1_1_line_response}{LineResponse} status is OK but a USER can redefine this function for some specifications. \hypertarget{class_caziac_1_1_http_1_1_a_handle_response_a285539dd02b020491752fa828148076c}{
\index{Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}!pack@{pack}}
\index{pack@{pack}!Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}}
\subsubsection[{pack}]{\setlength{\rightskip}{0pt plus 5cm}void Caziac::Http::AHandleResponse::pack ()}}
\label{class_caziac_1_1_http_1_1_a_handle_response_a285539dd02b020491752fa828148076c}


write The \hyperlink{struct_caziac_1_1_http_1_1_line_request}{LineRequest}, the Header content and an empty line \begin{DoxyWarning}{Warning}
this function must be call at the end of Header parsing 
\end{DoxyWarning}
\hypertarget{class_caziac_1_1_http_1_1_a_handle_response_aa418134fb4b7ba580e1b7f6d94342f80}{
\index{Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}!sendBody@{sendBody}}
\index{sendBody@{sendBody}!Caziac::Http::AHandleResponse@{Caziac::Http::AHandleResponse}}
\subsubsection[{sendBody}]{\setlength{\rightskip}{0pt plus 5cm}Caziac::Http::AHandleResponse::sendBody (std::string const \& {\em bodyline})}}
\label{class_caziac_1_1_http_1_1_a_handle_response_aa418134fb4b7ba580e1b7f6d94342f80}


send a body line or an entire body \begin{DoxyWarning}{Warning}
if the Header wasn't send it will send automatically the header before 
\end{DoxyWarning}
\begin{DoxyReturn}{Returns}
true if the entire line was send
\end{DoxyReturn}
This function check the \char`\"{}Content-\/length\char`\"{} value of the Header, this will return false if the the length is too big. For example if you have:

In the header \char`\"{}Content-\/length : 20\char`\"{} 
\begin{DoxyCode}
        sendLine("Star wars \r\n");     // First call return true (size = 12)
        sendLine("Star wars \r\n");     // Second call return false (size = 12)
\end{DoxyCode}


This will send only the first call 

The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
\hyperlink{_a_handle_response_8hh}{AHandleResponse.hh}\end{DoxyCompactItemize}
